package com.zc.designmodel.structural.criteria;

import java.util.List;

/**
 * @author: zhuCan
 * @date: 2020/4/12 17:55
 * @description:
 */
public class AndCriteria implements Criteria{

  private Criteria criteria;
  private Criteria andCriteria;

  public AndCriteria(Criteria criteria,Criteria andCriteria){
    this.andCriteria=andCriteria;
    this.criteria=criteria;
  }


  @Override
  public List<Person> meetCriteria(List<Person> people) {
    List<Person> personList=criteria.meetCriteria(people);
    return andCriteria.meetCriteria(personList);
  }
}
